﻿using StackExchange.Redis;
using System.Threading.Tasks;

namespace Developer.Core.FrameWork.RedisExtensions.RedisSubscribeInit.Cache
{
    public interface ICacheService
    {
        ConnectionMultiplexer GetRedis();

        IDatabase GetDatabase();

        int TimeOut { set; get; }

        string Get(string key);

        T Get<T>(string key);

        void Remove(string key);

        void Set(string key, object data);

        void Set(string key, object data, int cacheTime);

        bool Exists(string key);

        string[] ScriptEvaluateKeys(string key);

        Task<long> ListLeftPushAsync(string key, string value);

        long ListLeftPush(string key, string value);

        Task<long> ListRightPushAsync(string key, string value);

        long ListRightPush(string key, string value);

        Task<T> ListLeftPopAsync<T>(string key) where T : class;

        T ListLeftPop<T>(string key) where T : class;

        Task<T> ListRightPopAsync<T>(string key) where T : class;

        T ListRightPop<T>(string key) where T : class;

        Task<string> ListLeftPopAsync(string key);

        string ListLeftPop(string key);

        Task<string> ListRightPopAsync(string key);

        string ListRightPop(string key);

        Task<long> ListLengthAsync(string key);

        long ListLength(string key);
    }
}
